#ifndef SECTION_LOCATE_H__
#define SECTION_LOCATE_H__

#ifdef __cplusplus
extern "C" {
#endif

#include <stdint.h>

typedef void (*func)(void);
typedef  uint32_t *func_name;

struct func_pack {
    func        func_addr;
    func_name   name_str;
};

#define PLACE_FUNC_AT_SEC(func)    \
static char name[30] = #func;   \
struct func_pack sec_##func __attribute__ ( ( section ( "func_area" ) ) ) = {   \
    .func_addr = func,  \
	.name_str = (uint32_t *)&name,  \
}


#ifdef __cplusplus
}
#endif

#endif // SECTION_LOCATE_H__


